package com.cl.short_video_java.menum;

/**
 * 广告位置
 */
public enum AdPosition {
	//    'user_top','user_bottom','home_top','pop_ups','home_bottom','type_top','type_bottom'
	USER_TOP(5, "user_top"),//用户中心头部
	USER_BOTTOM(6, "user_bottom"),//用户中心底部
	HOME_TOP(1, "home_top"),//首页头部
	POP_UPS(0, "pop_ups"),//弹窗
	HOME_BOTTOM(2, "home_bottom"),//首页底部
	TYPE_TOP(3, "type_top"),//分类头部
	TYPE_BOTTOM(4, "type_bottom");//分类底部

	private String position;
	private Integer code;

	AdPosition(Integer code, String position) {
		this.position = position;
		this.code = code;
	}

	public String getPosition() {
		return position;
	}

	public static String getValueByKey(int targetKey) {
		for (AdPosition entry : AdPosition.values()) {
			if (entry.code == targetKey) {
				return entry.position;
			}
		}
		return "";
	}

	public Integer getCode() {
		return code;
	}

}
